package com.forever7776.life.web.controller.life.front;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.plugins.Page;
import com.forever7776.life.core.common.vo.FriendlyLinkSearchVO;
import com.forever7776.life.core.entity.FriendlyLink;
import com.forever7776.life.core.service.IFriendlyLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import util.ResultUtil;

/**
 * <p>
 * 友情链接
 * </p>
 *
 * @author kz
 * @date 2018-03-27
 */
@Controller
@RequestMapping("/friendly/link")
public class FrontFriendlyLinkController {

    @Autowired
    private IFriendlyLinkService iFriendlyLinkService;

    @RequestMapping(value = "/list", method = RequestMethod.POST)
    @ResponseBody
    public JSONObject list() {
        JSONObject result = ResultUtil.getSuccessResult("");
        FriendlyLinkSearchVO vo = new FriendlyLinkSearchVO();
        vo.setStatus(0);
        result.put("page", iFriendlyLinkService.selectAll(new Page<FriendlyLink>(), vo));
        return result;
    }
}
